package com.zhss.springbootdemo01.service;

import com.zhss.springbootdemo01.dao.UserDAO;
import com.zhss.springbootdemo01.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName UserServiceImpl
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/2/6 18:15
 * @Version 1.0
 */
@Service
public class UserServiceImpl implements UserService{
	@Autowired
 	private UserDAO userDAO;


	@Override
	public List<User> listUsers() {
		return userDAO.listUsers();
	}

	@Override
	public User getUserById(Long userId) {
		return userDAO.getUserById(userId);
	}

	@Override
	public void saveUser(User user) {
		userDAO.saveUser(user);
	}

	@Override
	public void updateUser(User user) {
		userDAO.updateUser(user);
	}

	@Override
	public void removeUser(Long userId) {
		userDAO.removeUser(userId);
	}
}
